package com.library.controller.user;

import com.library.pojo.Category;
import com.library.pojo.Result;
import com.library.service.CategoryService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController("userCategory")
@RequestMapping("/user/category")
public class CategoryController {
    @Autowired
    private CategoryService categoryService;
    @GetMapping
    public Result getCategoryName(String name){
        List<Category> result = categoryService.getCategory(name);
        return Result.success(result);
    }
}
